BIN=bite.exe
SRC=$(wildcard *.c) # wildcard函数，获取当前目录下所有的源文件
OBJ=$(SRC:.c=.o)
CC=gcc
Echo=echo
Rm=rm -rf

$(BIN):$(OBJ)
	@$(CC) -o $@ $^
	@$(Rm) "linking $^ to $@ ...done"
%.o:%.c
	@$(CC) -c $<
	@$(Echo) "compeling $< to $@ ... done"

.PHONY:clean
clean:
	@$(Rm) $(OBJ) $(BIN)

.PHONY:test
test:
	@echo $(OBJ)
